#include <stdio.h>

int main()
{
    int year,a=0;
    scanf("%d",&year);
    if((year%4==0 && year%100!=0)||(year%400==0))
        a=1;
    printf("%d",a);
    return 0;
}